<?php

$syntax_config_file = dirname(__FILE__) . "/config";
$syntax_styles = getURL(glob(dirname(__FILE__) . "/styles/*.css"));
$syntax_styles_filenames = array();

foreach ($syntax_styles as $k => $i)
{
    //$html_head_code[] = '<link rel="alternate stylesheet" type="text/css" href="' . $i . '"/>';

    $syntax_styles_filenames[$k] = substr($i, strrpos($i, "/") + 1);
}

if ($p_data)
{
    file_put_contents($syntax_config_file, serialize(array(
                "syntax_stylesheet" => $p_data['syntax_stylesheet'],
                "aof" => !empty($p_data['aof']),
                "aob" => !empty($p_data['aob']))
    ));
}

$smarty->assign("syntax_styles", $syntax_styles);
$smarty->assign("syntax_styles_filenames", $syntax_styles_filenames);

if (file_exists($syntax_config_file))
{
    $syntax_config = unserialize(file_get_contents($syntax_config_file));
    $smarty->assign("syntax_config", $syntax_config);
}

return $smarty->fetch('config.tpl');
?>